<?php

namespace app\company\model;

use app\common\model\BaseModel;
use app\common\model\CompanyWarehouse;
use app\common\model\DealerGoods;
use app\common\model\DealerGoodsSpec;
use think\model\relation\BelongsTo;

class CompanyOrderDetail extends BaseModel
{
    public function orders(): BelongsTo
    {
        return $this->belongsTo(CompanyOrder::class, 'company_sale_order_id', 'id');
    }
    public function order(): BelongsTo
    {
        return $this->belongsTo(CompanyOrder::class,'company_order_id', 'id' );
    }
    public function goods(): BelongsTo
    {
        return $this->belongsTo(DealerGoods::class, 'dealer_goods_id', 'id');
    }

    public function goodsSpec(): BelongsTo
    {
        return $this->belongsTo(DealerGoodsSpec::class, 'dealer_goods_spec_id', 'id');
    }

    public function warehouse(): BelongsTo
    {
        return $this->belongsTo(CompanyWarehouse::class, 'company_warehouse_id', 'id');
    }
}